package com.chunuo.mvc.service.impl;

import com.chunuo.configuration.annotation.Autowired;
import com.chunuo.configuration.annotation.Component;
import com.chunuo.mvc.dao.UserDao;
import com.chunuo.mvc.entity.SysUser;
import com.chunuo.mvc.service.UserService;

import java.util.List;

/**
 * 类的作用
 *
 * @author liujiamiao
 * @email 2544296058@qq.com
 * @date 2020-12-22 13:29
 */
@Component
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public void saveOrUpdate(SysUser sysUser) {
        userDao.saveOrUpdate(sysUser);
    }


    @Override
    public void delete(SysUser sysUser) {
        userDao.delete(sysUser);
    }

    @Override
    public List<SysUser> findSysUserList() {
        return userDao.findSysUserList();
    }

    @Override
    public SysUser findSysUserById(String id) {
        return userDao.findSysUserById(id);
    }

    @Override
    public String findUserNameById(String id) {
        return userDao.findUserNameById(id);
    }

    @Override
    public int update(SysUser sysUser) {
        return userDao.update(sysUser);
    }

    @Override
    public int deleteSysUserByUsername(String username,String id) {
        return userDao.deleteSysUserByUsername(id,username);
    }
}
